package tests;

import java.sql.SQLException;
import java.util.List;

import persistencia.AgenteBD;

import junit.framework.TestCase;
import dominio.Controller;
import dominio.Enfermo;
import dominio.Socio;
import dominio.Usuario;

public class TestSocioManagement extends TestCase {

	public void testCreateSocio() {
		try {
			Socio s = new Socio((int)(Math.random()*1000), "2000-12-01", "2010-11-02", "Se canso de Nestor", false, "Jose Julian", "del Bosque", "1989-01-30", "hombre", "93829183S", "casado/a", "Calle Falsa 4, 5ºA", "Motilla", "Cuenca", "96926378", null, "analfabeto", "Casamentero", null, false, 16003, 0, "familiar", null);
			AgenteBD.getInstance().saveSocio(s);
			assertTrue(true);
			Socio s2 = new Socio((int)(Math.random()*1000), "2000-12-01", null, null, false, "Ramón", "Camacho", "1989-01-30", "mujer", ("" + Math.random()).substring(2, 10), "soltero/a", "Calle del acordeon 4, 5ºA", "Manzanares", "Ciudad Real", "96926378", "661556724", "conocimientos minimos", null, null, false, 16003, 0, "familiar", null);
			AgenteBD.getInstance().saveSocio(s2);
			assertTrue(true);
			Socio s3 = new Socio((int)(Math.random()*1000), "2000-12-01", null, null, true, "Jose Francisco", "Garrido", "1989-01-30", "mujer", ("" + Math.random()).substring(2, 10), "divorciado/a", "Calle del acordeon 4, 5ºA", "Manzanares", "Ciudad Real", "96926378", null, "conocimientos minimos", "Perroflauta", "67543253647689109876", true, 16003, 2010, "persona interesada", "Esto es un comentario del tio este");
			AgenteBD.getInstance().saveSocio(s3);
			assertTrue(true);
			Enfermo e = new Enfermo((int)(Math.random()*1000), "2000-10-12", null, null, true, "Rebeca", "Gonzalez Galindo", "1988-12-30", "mujer", "12567665X", null, "Calle del Acoplamiento Basico", "La Almarcha", "Cuenca", "969887654", "66155768", null, "Chupatintas", null, false, 13008, 2011, null, "Estaba un poco para allá", null, false, true, null, null, "con padres", "parado", true, null, null, "capacitado", "otros");
			AgenteBD.getInstance().saveSocio(e);
			assertTrue(true);
			Enfermo e2 = new Enfermo((int)(Math.random()*1000), "2020-10-12", "2000-12-01", "Se fue sin mas", true, "Carlitos", "Patizambo Ramírez", "2018-12-30", "hombre", "99877665X", "viudo/a", "Calle del Acoplamiento Basico", "La Almarcha", "Cuenca", "969887654", "66155768", null, "Chupatintas", null, false, 13008, 2011, null, "Estaba un poco para allá", null, false, true, null, null, "con padres", "parado", true, null, null, "capacitado", "otros");
			AgenteBD.getInstance().saveSocio(e2);
			assertTrue(true);
		} catch (SQLException e) {
			fail("SQLException: " + e.getMessage());
		}
	}

	

}
